package algorithm
{
	import struct.IComparable;
	
	public class AStarVertex implements IComparable
	{
		public var G:int;
		public var H:Number;
		public var x:int;
		public var y:int;
		public var pre:AStarVertex;
		public var searchNo:int;
		
		public function AStarVertex()
		{
		}
		
		public function compare(v:IComparable):int
		{
			return this.distance - (v as AStarVertex).distance;
		}
		
		public function get distance():Number {
			return G + H;
		}
		
		public function toString():String {
			return "x:" + x + " y:" + y + "G:" + G + " H:" + H + " d:" + distance;
		}
	}
}